home *** CD-ROM | disk | FTP | other *** search
/ 10,000 Great Games / 10,000 Great Games.iso / Product / 66 / data1.cab / Source_Files / Src / Dripping.cpp < prev    next >
C/C++ Source or Header  |  2000-01-16  |  862b  |  52 lines

  1. #include "stdafx.h"
  2.  
  3. cDripping::cDripping(int _x, int _y, cProperties *_orig)
  4.         : cScenery(_x, _y, _orig)
  5.     ASSERT(orig->spot != 0);
  6.  
  7.     orig->get_sequence("MOVING", drip_seq);
  8.     set_sequence(drip_seq, FALSE);
  9. }
  10.  
  11. cDripping::~cDripping()
  12. {
  13. }
  14.  
  15. int cDripping::control()
  16.     // Do nothing when in low detail mode
  17.  
  18.     if (low_detail_level)
  19.         return TRUE;
  20.  
  21.     // Control
  22.  
  23.     cScenery::control();
  24.     
  25.     // Check if we fell onto something
  26.     
  27.     if (animation_done())
  28.     {
  29.         // Create drop
  30.     
  31.         ASSERT(orig->spot != 0);
  32.         
  33.         new cFallingScenery(x + orig->spot->x, y - orig->spot->y, water_drop);
  34.         
  35.         // Make dripping sound
  36.         
  37.         //new cEffect(x, y, orig, "DROP");
  38.         
  39.         // Restart sequence
  40.         
  41.         add_sequence(drip_seq);
  42.         
  43.         // Set image delay for first image in sequence
  44.         
  45.         set_image_delay(rnd(2 * sec));
  46.     }
  47.     
  48.     return TRUE;
  49. }
  50.